home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / shells / scsh-0.4 / scsh-0 / scsh-0.4.2 / vm / interfaces.scm < prev    next >
Text File  |  1995-10-13  |  6KB  |  234 lines

  1.  
  2. (define-interface vm-utilities-interface
  3.   (export adjoin-bits low-bits high-bits unsigned-high-bits
  4.       assert
  5.       read-number write-number
  6.       vector+length-fill!))
  7.  
  8. (define-interface vm-architecture-interface
  9.   (export (enum :syntax) ;so you don't have to remember to open enumerated
  10.       bits-used-per-byte
  11.       maximum-stack-args
  12.       interrupt
  13.       interrupt-count
  14.       memory-status-option
  15.       op
  16.       op-count
  17.       opcode-arg-specs
  18.       stob
  19.       stob-count
  20.       least-b-vector-type
  21.       stob-data
  22.       time-option
  23.       ))
  24.  
  25. ; Memory
  26.  
  27. (define-interface memory-interface
  28.   (export create-memory memory-begin memory-size
  29.  
  30.       bytes-per-cell bits-per-cell
  31.       bytes->cells
  32.       cells->bytes
  33.       a-units->cells
  34.       cells->a-units
  35.       bytes->a-units
  36.       addr+ addr- addr1+ addr= addr< addr<= addr> addr>= 
  37.  
  38.       fetch fetch-byte
  39.       store! store-byte!
  40.       write-bytes read-bytes
  41.       ))
  42.  
  43. ; Low-level data structures
  44.  
  45. (define-interface data-interface
  46.   (export vm-eq?
  47.       fixnum? immediate? header? stob?
  48.  
  49.       enter-fixnum extract-fixnum
  50.       bits-per-fixnum too-small-for-fixnum? too-big-for-fixnum?
  51.       vm-= vm-<
  52.  
  53.       undefined?
  54.       true false eof-object null unspecific quiescent
  55.       unbound-marker unassigned-marker
  56.       vm-boolean? false? enter-boolean extract-boolean
  57.       vm-char? enter-char extract-char vm-char=? vm-char<?
  58.  
  59.       make-header header-type
  60.       header-length-in-bytes header-length-in-cells
  61.       immutable-header? make-header-immutable
  62.       d-vector-header? b-vector-header?
  63.       max-stob-size-in-cells
  64.  
  65.       address->stob-descriptor
  66.       stob-descriptor->address
  67.       ))
  68.       
  69. (define-interface fixnum-arithmetic-interface
  70.   (export add-carefully subtract-carefully
  71.       multiply-carefully divide-carefully
  72.       quotient-carefully remainder-carefully
  73.       shift-carefully
  74.       abs-carefully
  75.       ))
  76.  
  77. (define-interface stob-interface
  78.   (export make-d-vector make-b-vector universal-key
  79.       stob-header stob-header-set!
  80.           d-vector-length d-vector-ref d-vector-set!
  81.       b-vector-length b-vector-ref b-vector-set!
  82.  
  83.       stob-length-in-bytes stob-of-type?
  84.       copy-stob copy-cells!
  85.       stob-equal?
  86.       valid-index?
  87.           
  88.       immutable? make-immutable!
  89.       address-at-header address-after-header address-after-stob
  90.       ))
  91.  
  92. (define-interface heap-interface
  93.   (export initialize-heap
  94.       register-static-areas
  95.  
  96.           available? available heap-size
  97.       preallocate-space
  98.           
  99.       begin-collection
  100.       trace-value trace-locations
  101.       trace-impure-areas
  102.       do-gc
  103.       end-collection abort-collection
  104.       gc-count
  105.  
  106.       image-writing-okay? write-image
  107.       check-image-header read-image
  108.  
  109.       walk-over-symbols find-all-xs
  110.       ))
  111.  
  112. (define-interface struct-interface
  113.   (export vm-pair? vm-pair-size vm-cons vm-car vm-set-car! vm-cdr vm-set-cdr!
  114.       vm-symbol? vm-symbol-size vm-symbol->string
  115.       closure? closure-size make-closure closure-template closure-env
  116.       location? location-size make-location contents set-contents! location-id
  117.       weak-pointer? weak-pointer-size make-weak-pointer weak-pointer-ref
  118.       external? external-size make-external external-name external-value
  119.  
  120.       port? port-size make-port
  121.       port-mode   set-port-mode!
  122.       port-index  set-port-index!
  123.       peeked-char set-peeked-char!
  124.       port-id     set-port-id!
  125.    
  126.       vm-vector? vm-vector-size vm-make-vector vm-vector-length
  127.       vm-vector-ref vm-vector-set!
  128.       vm-vector-fill!
  129.  
  130.       record? record-size vm-make-vector record-length
  131.       record-ref record-set!
  132.  
  133.       extended-number? extended-number-size vm-make-vector extended-number-length
  134.       extended-number-ref extended-number-set!
  135.  
  136.       continuation? continuation-size vm-make-vector continuation-length
  137.       continuation-ref continuation-set!
  138.       continuation-cont     set-continuation-cont!
  139.       continuation-pc       set-continuation-pc!
  140.       continuation-template set-continuation-template!
  141.       continuation-env      set-continuation-env!
  142.       continuation-cells
  143.  
  144.       code-vector? code-vector-size make-code-vector code-vector-length
  145.       code-vector-ref code-vector-set!
  146.  
  147.       template? template-size make-template template-length
  148.       template-ref template-set!
  149.       template-code template-name
  150.       make-template-containing-ops op-template-size
  151.  
  152.       vm-string? vm-string-size vm-make-string vm-string-length
  153.       vm-string-ref vm-string-set!
  154.       enter-string extract-string
  155.       write-vm-string vm-string=? vm-string-hash
  156.  
  157.       intern add-to-symbol-table
  158.       ))
  159.  
  160. (define-interface vmio-interface
  161.   (export initialize-i/o-system initial-i/o-heap-space
  162.       initial-input-port initial-output-port
  163.  
  164.       extract-port
  165.           vm-input-port? vm-output-port?
  166.       open-port
  167.       open?
  168.       close-port
  169.       close-untraced-ports!
  170.       ))
  171.  
  172. (define-interface environment-interface
  173.   (export current-env set-current-env!
  174.       env-ref env-set! env-parent env-back
  175.       stack-env-space pop-args-into-env
  176.           heap-env-space pop-args-into-heap-env
  177.       current-env-size preserve-current-env
  178.       ))
  179.  
  180. (define-interface stack-interface
  181.   (export initialize-stack initial-stack-heap-space
  182.       
  183.       reset-stack-pointer stack-size
  184.       push pop stack-ref stack-set!
  185.       arg-stack-overflow-nargs
  186.  
  187.           ensure-stack-space
  188.       reserve-exception-space allow-exception-consing
  189.  
  190.       stack-continuation-size
  191.       push-continuation-on-stack
  192.       pop-continuation-from-stack
  193.  
  194.       current-continuation-size current-continuation
  195.       set-current-continuation!
  196.       peek-at-current-continuation skip-current-continuation!
  197.       get-continuation-from-heap
  198.  
  199.       trace-stack
  200.  
  201.       arguments-on-stack
  202.       move-args-above-cont!
  203.       pointer-to-stack-arguments  ; for calling external procedures
  204.       remove-stack-arguments  
  205.       ))
  206.  
  207. (define-interface external-interface
  208.   (export extended-vm
  209.  
  210.       ps-real-time
  211.       ps-run-time
  212.       ps-ticks-per-second
  213.       ps-schedule-interrupt
  214.       lookup-external-name
  215.       ))
  216.  
  217. ; From Scheme 48
  218. (define-interface ps-enumerated-interface
  219.   (export (define-enumeration :syntax)
  220.       (enum :syntax)
  221.       (enumerand->name :syntax)
  222.       (name->enumerand :syntax)))
  223.  
  224. ; What the external world can call
  225. (define interpreter-interface
  226.   (export required-init-space
  227.       initialize-vm
  228.       register-static-areas
  229.       call-startup-procedure
  230.       check-image-header
  231.       read-image
  232.       do-gc
  233.       note-interrupt!))
  234.